<template>
	<page-body>
		<view class="page">
			<view class="flex benben-position-layout flex flex-wrap align-center kspc_flex_0_higd"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-between flex-sub kspc_fd0_0_higd'>
					<view class='flex flex-wrap align-center kspc_fd0_0_c0_higd' @tap.stop="handleJumpDiy"
						data-type="back" data-url="1">
						<text class='fu-iconfont2  kspc_fd0_0_c0_c0_higd'>&#xE794;</text>
					</view>
					<view class='flex flex-wrap align-stretch justify-center'>
						<text class='kspc_fd0_0_c1_c0_higd'>{{title}}</text>
					</view>
					<view class='flex flex-wrap align-center justify-end kspc_fd0_0_c0_higd'>
						
						<!-- #ifndef MP-WEIXIN -->
						<text  @tap.stop="handleJumpDiy"
						data-type="navigateTo" :data-url="`/pageyhpc/yhpc/yhpcx/yhpcx?aid=${ids}&title=${title}`" class='kspc_fd0_0_c2_c0_higd'>{{$t('详情')}}</text>
						<!-- #endif -->
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<benben-popup v-model="popupShow1748333214590" :mask="true" :mask-close-able="false" mode='center'>
				<!---flex布局flex布局开始-->
				<view class="flex flex-direction flex-wrap align-start benben-flex-layout kspc_flex_1_higd">
					<view class='flex flex-direction flex-wrap align-stretch kspc_fd1_0_higd'>
						<view class='flex flex-wrap align-center justify-center kspc_fd1_0_c0_higd'>
							<image class='kspc_fd1_0_c0_c0_higd' mode="aspectFit" :src='STATIC_URL+"138.png"'></image>
						</view>
						<view class='flex flex-wrap align-center justify-center kspc_fd1_0_c1_higd'>
							<text class='kspc_fd1_0_c1_c0_higd'>{{$t('提交成功')}}</text>
						</view>
						<view class='flex flex-wrap align-center justify-around kspc_fd1_0_c2_higd'>
							<button class='kspc_fd1_0_c2_c0_higd' @tap.stop="backFunc()">{{$t('返回')}}</button>
							<!-- <button class='kspc_fd1_0_c2_c1_higd'   >{{$t('下一项')}}</button>
 -->
						</view>
					</view>
					<!-- <image class='kspc_fd1_1_higd'  mode="aspectFit"  :src='STATIC_URL+"78.png"' @tap.stop="popupShow1748333214590=false" ></image>
 -->
				</view>

				<!---flex布局flex布局结束-->

			</benben-popup>
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction align-stretch benben-flex-layout kspc_flex_2_higd">
				<view class='flex flex-direction align-stretch kspc_fd2_0_higd'>
					<view class='flex flex-direction align-stretch'>
						<view class='flex flex-wrap align-center kspc_fd2_0_c0_c0_higd'>
							<text class='kspc_fd2_0_c0_c0_c0_higd'>{{$t('评分明细')}}</text>
						</view>
						<view class='flex flex-wrap align-center'>
							<text class='kspc_fd2_0_c0_c1_c0_higd'>{{info.pfxz}}</text>
						</view>
					</view>
					<view class='flex flex-direction align-stretch kspc_fd2_0_c1_higd'>
						<view class='flex flex-wrap align-center kspc_fd2_0_c0_c0_higd'>
							<text class='kspc_fd2_0_c0_c0_c0_higd'>{{$t('依据标准')}}</text>
						</view>
						<view class='flex flex-wrap align-center'>
							<text class='kspc_fd2_0_c0_c1_c0_higd'>{{info.tjbz}}</text>
						</view>
					</view>
					<view class='flex flex-direction align-stretch'>
						<view class='flex flex-wrap align-center kspc_fd2_0_c0_c0_higd'>
							<text class='kspc_fd2_0_c0_c0_c0_higd'>{{$t('依据条目')}}</text>
						</view>
						<view class='flex flex-wrap align-center'>
							<text class='kspc_fd2_0_c0_c1_c0_higd'>{{info.yjtm}}</text>
						</view>
					</view>
				</view>
				<view class='flex flex-wrap align-center justify-between kspc_fd2_1_higd'>
					<view class='flex flex-wrap align-center'>
						<text>{{$t('评分分值')}}</text>
					</view>
					<view class='flex flex-wrap align-center'>

						<benben-flex-number-box class-name='flex flex align-center'
							input-class="kspc_numberBoxInputfd2_1_c1_c0_higd" v-model="pfz" :min="1" :max="100"
							:step="1" :opacity="0.3">
							<template #minus>
								<image class='kspc_fd2_1_c1_c0_c0_higd' mode="aspectFit" :src='STATIC_URL+"74.png"'>
								</image>
							</template>
							<template #plus>
								<image class='kspc_fd2_1_c1_c0_c0_higd' mode="aspectFit" :src='STATIC_URL+"75.png"'>
								</image>
							</template>

						</benben-flex-number-box>

					</view>
				</view>
				<view class='flex flex-direction align-stretch kspc_fd2_2_higd'>
					<view class='flex flex-wrap align-center kspc_fd2_2_c0_higd'>
						<text>{{$t('评估结论')}}</text>
					</view>
					<view class='flex flex-wrap kspc_fd2_2_c1_higd'>
						<benben-textarea class='flex kspc_input_fd2_2_c1_higd'
							:placeholder="$t('问题描述的越详细，有助于我们更快的解决问题')" :adjust-position='true' :maxlength="240"
							placeholder-style="color:#999;font-size:28rpx" v-model="wtms" />

					</view>
					<view class='flex flex-wrap align-center'>
						<benben-images-upload ref="benbenImagesUploadfd2_2_c2_c0" :img-list.sync="file"
							:img-ids.sync="img_id" :maxlength="9" v-if="video==''">
							<template #content="{ num, maxlength, isShow}">
								<view class='flex flex-wrap align-start flex kspc_fd2_2_c2_c0_higd'>

									<view v-for="(image, index) in file" :key="index"
										class='flex position-relative kspc_fd2_2_c2_c00_higd'>
										<benben-clean-icon
											class='fu-iconfont2 position-absolute kspc_fd2_2_c2_c000_higd'
											hand-name="benben-images-upload" hand-method="delImage" :hand-index="index">
											&#xE8E7;</benben-clean-icon>
										<benben-image-item class='kspc_fd2_2_c2_c001_higd' mode="aspectFill"
											hand-name="benben-images-upload" hand-method="previewImage"
											:hand-index="index" :src='image'></benben-image-item>
									</view>


									<benben-image-item class='kspc_fd2_2_c2_c01_higd' mode="aspectFill"
										hand-name="benben-images-upload" hand-method="manyChooseImage" v-if="isShow"
										:src='STATIC_URL+"76.jpg"'></benben-image-item>

								</view>
							</template>
						</benben-images-upload>

						<benben-video-upload-paas ref="upload1749030115157" :upload-data.sync="video"
							:video-info.sync="videos" isShowClean='true' v-if=" file.length==0">
							<template v-slot="{src, poster}">
								<view class='flex position-relative kspc_fd2_2_c2_c1_higd'>
									<image v-if="uptype == 0" class='kspc_fd2_2_c2_c001_higd' mode="aspectFill"
										:src='poster?poster:STATIC_URL+"243.png"'></image>
										<image v-if="!src && uptype == 2" class='kspc_fd2_2_c2_c001_higd' mode="aspectFill"
										:src='STATIC_URL+"243.png"'></image>
										<video  style="width: 650rpx;height: 180px;border-radius:16rpx ;" v-if="src&& uptype == 2" :src="src"></video>
									<benben-clean-icon class='fu-iconfont2 position-absolute kspc_fd2_2_c2_c000_higd'
										v-if="src" hand-name="benben-video-upload-paas" hand-method="delVideo">&#xE8E7;
									</benben-clean-icon>

								</view>
							</template>
						</benben-video-upload-paas>

					</view>
					<view class='flex flex-wrap align-center kspc_fd2_2_c3_higd'>
						<text>{{$t('请上传照片或视频')}}</text>
					</view>
					<view class='flex flex-wrap align-center' @tap.stop="checkswichFunc()">
						<view class='flex flex-direction align-center justify-center kspc_fd2_2_c4_c0_higd'
							@tap.stop="checkswichFunc()">
							<text class='self-center kspc_fd2_2_c4_c0_c0_higd'
								v-if=" isswich===1">{{$t('正常')}}</text><text
								class='self-center kspc_fd2_2_c4_c0_c0_1_higd' v-if=" isswich===2">{{$t('正常')}}</text>
						</view>
						<view class='flex flex-wrap align-center justify-center kspc_fd2_2_c4_c1_higd'
							@tap.stop="checkswichFunc()">
							<text class='kspc_fd2_2_c4_c1_c0_higd' v-if=" isswich===1">{{$t('异常')}}</text><text
								class='kspc_fd2_2_c4_c1_c0_1_higd' v-if=" isswich===2">{{$t('异常')}}</text>
						</view>
					</view>
				</view>
				<view class='flex flex-wrap align-center justify-center kspc_fd2_3_higd'
					@tap.stop="getto73ed3f6d63a6Func()">
					<button class='kspc_fd2_3_c0_higd'>{{$t('提交反馈')}}</button>
				</view>
			</view>

			<!---flex布局flex布局结束-->
			<!-- #ifdef MP-WEIXIN -->
			<view class="btn-fixed" @tap.stop="handleJumpDiy" data-type="navigateTo"
				:data-url="`/pageyhpc/yhpc/yhpcx/yhpcx?aid=${ids}&title=${title}`">
				详情
			</view>
			<!-- #endif -->
		
		</view>
	</page-body>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'
	import { SERVER_TYPE } from '@/common/config.js'
	export default {
		components: {},


		data() {
			return {
				uptype:0,// 服务端类型 0:赛诸葛（现在oss)  1  mock  2:其他（本地上传)
				"popupShow1748333214590": false,
				"isswich": 1,
				/** yjtm【依据条目】
				 *   yjbz【依据标准】
				 *   pfxz【评分细则】
				 *   pfz【评分分值】
				 *   mc【名称】
				 *   yhx_zbmc【指标名称】
				 *   aid【ID】 **/
				"info": {
					"aid": "",
					"yhx_zbmc": "",
					"mc": "",
					/** pfz【评分值】 **/ "pfz": "",
					"pfxz": "",
					"yjbz": "",
					"yjtm": ""
				},
				/** wtms【问题描述】 **/ "wtms": "",
				/** pfz【评分值】 **/ "pfz": "",
				"file": [],
				"img_id": "",
				/** video【视频】 **/ "video": "",
				"videos": {},
				"id": "",
				"title": "",
				"ids": ""
			};
		},
		computed: {

		},
		watch: {},
		onLoad(options) {
			let {
				id,
				title,
				ids
			} = options
			if (id !== undefined) this.id = id
			if (title !== undefined) this.title = title
			if (ids !== undefined) this.ids = ids
			this.getys84295c6409e8Func()
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {
			this.uptype=SERVER_TYPE
		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//开关
			checkswichFunc() {
				console.log(this.isswich)
				this.isswich = this.isswich == 1 ? 2 : 1
				console.log(this.isswich)
			},
			//返回上一页
			backFunc() {
				uni.$emit('pc', this.isswich)
				this.popupShow1748333214590 = false;
				this.$urouter.navigateBack(1);
			},
			//开始排查-隐患排查
			async getto73ed3f6d63a6Func() {
				console.log({
					pf: this.pfz,
					wtms: this.wtms,
					file: this.file,
					pcrwxq_id: this.id,
					pcjg: this.isswich,
					video: this.video
				})
				if (!this.pfz) {
					this.$message.info('请评分');
					return
				}
				if(this.file.length == 0 && !this.video){
					this.$message.info('请上传图片或视频')
					return
				}
				//请求方法
				//数据验证

				let data673ed3f6d63a6 = await this.$api.post(global.apiUrls.post673ed3f6d63a6, {
					pf: this.pfz,
					wtms: this.wtms,
					file: this.file,
					pcrwxq_id: this.id,
					pcjg: this.isswich,
					video: this.video
				});

				if (data673ed3f6d63a6.data.code != 1) {
					this.$message.info(data673ed3f6d63a6.data.msg);
					return
				}
				let info673ed3f6d63a6 = data673ed3f6d63a6.data;

				console.log(info673ed3f6d63a6)
				if (info673ed3f6d63a6.code == 1) {
					this.popupShow1748333214590 = true;
				} else {
					uni.showToast({
						title: info673ed3f6d63a6.msg,
						mask: true,
						icon: 'none',
						duration: 1500
					});
				}


			},
			//查询隐患内容
			async getys84295c6409e8Func() {
				//请求方法
				//数据验证

				let datainfo = await this.$api.get(global.apiUrls.post684295c6409e8, {
					aid: this.ids
				});

				if (datainfo.data.code != 1) {
					this.$message.info(datainfo.data.msg);
					return
				}
				let infoinfo = datainfo.data;
				this.info = infoinfo.data

			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #F8F8F8;
		background-size: 100% auto;

		.kspc_flex_2_higd {
			margin: 16rpx 0rpx 0rpx 0rpx;

			.kspc_fd2_0_higd {
				padding: 32rpx;
				background: rgba(255, 255, 255, 1);
				background-size: 100% auto;
				border-radius: 16rpx;
				margin: 0rpx 0rpx 32rpx 0rpx;

				.kspc_fd2_0_c1_higd {
					margin: 0rpx 0rpx 24rpx 0rpx;
				}
			}

			.kspc_fd2_1_higd {
				padding: 24rpx;
				background: rgba(255, 255, 255, 1);
				background-size: 100% auto;
				margin: 0rpx 0rpx 24rpx 0rpx;
			}

			.kspc_fd2_2_higd {
				padding: 24rpx;
				background: rgba(255, 255, 255, 1);
				background-size: 100% auto;
				border-radius: 16rpx;
				margin: 0rpx 0rpx 32rpx 0rpx;

				.kspc_fd2_2_c0_higd {
					line-height: 66rpx;
				}

				.kspc_fd2_2_c1_higd {
					width: 100%;
					border-radius: 16rpx;
					background: rgba(247, 247, 247, 1);
					padding: 10rpx 10rpx 0rpx 16rpx;
					height: 220rpx;

					.kspc_input_fd2_2_c1_higd {
						width: 100%;
						height: 140rpx;
						font-size: 28rpx;
						font-weight: 400;
						color: #333;
						white-space: pre-wrap;
					}
				}

				.kspc_fd2_2_c2_c0_higd {
					width: 750rpx;
					padding: 24rpx 0rpx 0rpx 24rpx;
					margin: 0rpx 0rpx 24rpx 0rpx;

					.kspc_fd2_2_c2_c00_higd {
						margin: 0rpx 24rpx 24rpx 0rpx;
					}

					.kspc_fd2_2_c2_c01_higd {
						width: 200rpx;
						height: 200rpx;
						margin: 0rpx 24rpx 24rpx 0rpx;
					}
				}

				.kspc_fd2_2_c2_c1_higd {
					margin: 0rpx 0rpx 0rpx 24rpx;
				}

				.kspc_fd2_2_c3_higd {
					margin: 32rpx 0rpx 32rpx 0rpx;
				}

				.kspc_fd2_2_c4_c0_higd {
					width: 104rpx;
					height: 60rpx;
					border-radius: 30rpx 0rpx 0rpx 30rpx;

					.kspc_fd2_2_c4_c0_c0_higd {
						color: var(--benbenFontColor3);
						width: 104rpx;
						height: 60rpx;
						background: rgba(252, 1, 1, 1);
						background-size: 100% auto;
						border-radius: 30rpx 0rpx 0rpx 30rpx;
						line-height: 60rpx;
						vertical-align: baseline;
						text-align: center;
					}

					.kspc_fd2_2_c4_c0_c0_1_higd {
						background: rgba(255, 242, 242, 1);
						background-size: 100% auto;
						line-height: 60rpx;
						width: 104rpx;
						text-align: center;
						height: 60rpx;
						color: rgba(211, 42, 41, 1);
						border-radius: 30rpx 0rpx 0rpx 30rpx;
					}
				}

				.kspc_fd2_2_c4_c1_higd {
					width: 104rpx;
					height: 60rpx;
					border-radius: 0rpx 30rpx 30rpx 0rpx;
					background: rgba(255, 242, 242, 1);
					background-size: 100% auto;

					.kspc_fd2_2_c4_c1_c0_higd {
						width: 104rpx;
						height: 60rpx;
						line-height: 60rpx;
						text-align: center;
						background: rgba(255, 242, 242, 1);
						background-size: 100% auto;
						color: rgba(211, 42, 41, 1);
						border-radius: 0rpx 30rpx 30rpx 0rpx;
					}

					.kspc_fd2_2_c4_c1_c0_1_higd {
						color: var(--benbenFontColor3);
						background: rgba(252, 1, 1, 1);
						background-size: 100% auto;
						border-radius: 0rpx 30rpx 30rpx 0rpx;
						width: 104rpx;
						height: 60rpx;
						line-height: 60rpx;
						text-align: center;
					}
				}
			}

			.kspc_fd2_3_higd {
				margin: 0rpx 0rpx 68rpx 0rpx;

				.kspc_fd2_3_c0_higd {
					border-radius: 44rpx;
					width: 90%;
					line-height: 88rpx;
					font-size: 24rpx;
					background: rgba(252, 1, 1, 1);
					color: #fff;
					height: 88rpx;
				}
			}
		}

		.kspc_fd2_0_c0_c0_higd {
			line-height: 88rpx;
		}

		.kspc_fd2_0_c0_c0_c0_higd {
			font-size: 32rpx;
			font-weight: 700;
		}

		.kspc_fd2_0_c0_c1_c0_higd {
			line-height: 44rpx;
		}

		.kspc_fd2_1_c1_c0_c0_higd {
			height: 50rpx;
			margin: 0rpx 4rpx 0rpx 4rpx;
			width: 50rpx;
		}

		.kspc_fd2_2_c2_c000_higd {
			top: 0rpx;
			right: 0rpx;
			z-index: 10;
			color: #ff5536;
		}

		.kspc_fd2_2_c2_c001_higd {
			width: 200rpx;
			height: 200rpx;
			border-radius: 16rpx;
		}

		.kspc_flex_1_higd {
			width: 510rpx;

			.kspc_fd1_0_higd {
				background: #fff;
				background-size: 100% auto !important;
				border-radius: 16rpx 16rpx 16rpx 16rpx;
				padding: 40rpx 0rpx 0rpx 0rpx;
				width: 510rpx;

				.kspc_fd1_0_c0_higd {
					margin: 32rpx 176rpx 32rpx 176rpx;

					.kspc_fd1_0_c0_c0_higd {
						width: 140rpx;
						height: 140rpx;
						border-radius: 0rpx 0rpx 0rpx 0rpx;
					}
				}

				.kspc_fd1_0_c1_higd {
					margin: 0rpx 0rpx 0rpx 0rpx;

					.kspc_fd1_0_c1_c0_higd {
						font-size: 32rpx;
						font-weight: 500;
						color: #333333;
					}
				}

				.kspc_fd1_0_c2_higd {
					padding: 0rpx 0rpx 45rpx 0rpx;

					.kspc_fd1_0_c2_c0_higd {
						border-radius: 33rpx 33rpx 33rpx 33rpx;
						width: 40%;
						line-height: 60rpx;
						font-size: 24rpx;
						background: rgba(255, 241, 240, 1);
						color: rgba(204, 34, 28, 1);
					}

					.kspc_fd1_0_c2_c1_higd {
						border-radius: 33rpx 33rpx 33rpx 33rpx;
						width: 40%;
						line-height: 60rpx;
						font-size: 24rpx;
						background: rgba(211, 42, 41, 1);
						color: #fff;
					}
				}
			}

			.kspc_fd1_1_higd {
				width: 60rpx;
				height: 60rpx;
				border-radius: 0rpx 0rpx 0rpx 0rpx;
				margin: 48rpx 0rpx 0rpx 241rpx;
			}
		}

		.kspc_flex_0_higd {
			width: 750rpx;
			height: 88rpx;
			overflow: hidden;
			z-index: 10;
			top: 0rpx;
			background: #fff;
			background-size: 100% auto !important;

			.kspc_fd0_0_higd {
				padding: 0rpx 32rpx 0rpx 32rpx;

				.kspc_fd0_0_c1_c0_higd {
					font-size: 36rpx;
					font-weight: 700;
					color: #333333;
					line-height: 50rpx;
				}
			}
		}

		.kspc_fd0_0_c0_higd {
			width: 120rpx;

			.kspc_fd0_0_c0_c0_higd {
				font-size: 36rpx;
				color: #333;
			}
		}

		.kspc_fd0_0_c2_c0_higd {
			font-size: 32rpx;
			color: rgba(204, 34, 28, 1);
		}
	}

	::v-deep .kspc_numberBoxInputfd2_1_c1_c0_higd {
		width: 80rpx;
		height: 50rpx;
		text-align: center;
		background: #f2f3f5;
		color: #323232;
		font-size: 28rpx;
	}
</style>
